<?php
class UserModel extends BaseModel {

	public function login($username,$password){
		$sql  ="select * from user where username='".$username."'";
		$row = $this->db->getRow($sql);
		if(md5(md5($password).$row["salt"]) == $row["password"]){
			session_start();
			$_SESSION["id"] = $row["uid"];
			return true;
		}


		$this->cache->set("");
		return false;
		

	}
}